package xdu.lz.stage3_classloader.chapter1;


class C{

}

class D{

}
public class ClassLoaderTest {
    public static void main(String[] args) {
        C c1 = new C();
        C c2 = new C();
        C c3 = new C();
        Class<? extends C> c1Class = c1.getClass();
        Class<? extends C> c2Class = c2.getClass();
        Class<? extends C> c3Class = c3.getClass();
        System.out.println("class实例【是在堆内存的地址，不是同一个】");
        System.out.println("c1 = " + c1);
        System.out.println("c2 = " + c2);
        System.out.println("c3 = " + c3);
        System.out.println("通过实例获取Class对象【Class对象是编译后的java文件编译后的class文件，该文件是被一个唯一Class对象锁描述】");
        System.out.println(c1.getClass());
        System.out.println(c2.getClass());
        System.out.println(c3.getClass());
        System.out.println("通过对象获得Class对象");
        System.out.println(C.class);
        System.out.println("classLoader【专门负责加载Class对象到JVM】");
        System.out.println("Class  C的类加载对象:"+C.class.getClassLoader());
        System.out.println("Class  D的类加载对象:"+D.class.getClassLoader());
    }
}
